With the development of computer network technology and video technology, the time synchronization of network devices plays an increasingly important role in the network.
In general, in a network device, such as a computer or a network camera, the device time is obtained by a hardware crystal oscillator chip in the device through calculation. However, due to factors such as manufacturing process, device cost, hardware design and so on, there is a certain error in the operation of the hardware crystal oscillator chip in the device, and this error has an important impact on the operation of the device. For example, for a linkage system of a multi-network camera, multiple network cameras monitor different locations in the same area. If the videos of all network cameras at the same moment need to be synchronously invoked, a large error in shooting time of these network cameras will result in the error analysis to the videos. For example, if the error in shooting time of two cameras is more than 5 seconds, there will be a delay of more than 5 seconds between two obtained videos, and the contents of the two videos are not video information at the same moment, which will result in error understanding and analysis. If the shooting time of these network cameras is well synchronous, the process of an event in video can be easily analyzed. Therefore, when the device operates for a period of time, it is necessary to correct the time of the device to ensure the accuracy and synchronization of the current time of the device.
In the existing time correction methods, the user usually needs to configure the address and time correction period of the time correction server. In the process of time correction, the user needs to send a time correction request periodically to the time correction server in the network. According to a time protocol, the device time is reconfigured by interacting with the time correction information of the time correction server.
The traditional time protocol is NTP (Network Time Protocol), which is mainly used to measure a round-trip transmission delay of a time correction request packet in the network and estimate a clock deviation of a device, and to correct the time of the device according to the estimated clock deviation. As shown in FIG. 1, a to-be-time-corrected network device 101 sends a time correction request; a time correction server 102 sends time correction data to the to-be-time-corrected network device 101 after receiving the time correction request; and the to-be-time-corrected network device 101 completes time correction after receiving the time correction data, and then sends a time correction completion status to the time correction server 102, to achieve the high-precision time correction of the device over the network.
In the existing technologies described above, in order to ensure the accuracy of the device time, a relatively short time correction interval is usually set for the time correction period. For example, the time correction interval is set to 30 seconds, and thus one time correction is performed every 30 seconds. This not only ensures the accuracy of the device time, but also ensures the synchronization among the devices. However, due to the relatively short time correction interval, many short-time time-correction data packets will be generated in the network, resulting in an increase in the amount of redundant data in the network.